package com.zjitc.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

/**
 * @Author luqi
 * @Date 2025 06 19 10 22
 **/

@Configuration
@ComponentScan({"com.zjitc.controller","com.zjitc.exception"})
@EnableWebMvc
public class SpringMvcConfig {

    @Bean
    public ViewResolver viewResolver() {
        InternalResourceViewResolver resolver = new InternalResourceViewResolver();
        resolver.setPrefix("/WEB-INF/views/");  // 视图文件所在目录
        resolver.setSuffix(".jsp");             // 视图文件后缀
        return resolver;
    }
}
